<?php
if (!defined('SMF'))
	die('Hacking attempt...');

global $smcFunc, $txt, $scripturl, $settings, $user_info;
global $dbtables;

// Verify user login, if CheckLogin() returns false return to the calling script/function
if (CheckLogin() == false)
	return;

//-------------------------------------------------------------------------------------------------

// Pull player info into $playerinfo.
$result = $smcFunc['db_query']('', '
	SELECT *
	FROM {raw:db_ships}
	WHERE user_id = {int:user_id}
	LIMIT 1',
	array(
		'db_ships' => $dbtables['ships'],
		'user_id' => $user_info['id'],
	)
);
$playerinfo = $smcFunc['db_fetch_assoc']($result);
$smcFunc['db_free_result']($result);

// Pull sector info into $sectorinfo.
$result = $smcFunc['db_query']('', '
	SELECT *
	FROM {raw:db_universe}
	WHERE sector_id = {int:sector_id}',
	array(
		'db_universe' => $dbtables['universe'],
		'sector_id' => $playerinfo['sector']
	)
);
$sectorinfo = $smcFunc['db_fetch_assoc']($result);
$smcFunc['db_free_result']($result);

// Get zone information
$result = $smcFunc['db_query']('', '
	SELECT zone_id, zone_name
	FROM {raw:db_zones}
	WHERE zone_id = {int:zone_id}',
	array(
		'db_zones' => $dbtables['zones'],
		'zone_id' => $sectorinfo['zone_id']
	)
);
$zoneinfo = $smcFunc['db_fetch_assoc']($result);
$smcFunc['db_free_result']($result);

echo '
						<h4 class="bnt_header_title">', player_insignia_name($playerinfo['user_id']), ' ', trim($playerinfo['character_name']) . $txt['bnt_abord'], '<a href="', $scripturl, '?action=blacknova;sa=report">', $playerinfo['ship_name'], '</a></h4>
						<ul>
							<li><span class="title">', $txt['bnt_turns_have'], ' </span><span id="turns_available" class="data">', NUMBER($playerinfo['turns']), '</span></li>
							<li><span class="title">', $txt['bnt_turns_used'], ' </span><span id="turns_used" class="data">', NUMBER($playerinfo['turns_used']), '</span></li>
							<li><span class="title">', $txt['bnt_score'], ' </span><span class="data">', NUMBER($playerinfo['score']), '</span></li>
						</ul>
						<script>
							$(\'.bnt_header_title\').corners("top-left top-right no-native");
						</script>';
?>